package com.oc.claimobs.bb.facade;

import com.oc.claimobs.bb.dao.BinaryFileDao;

public class ImageService {

	private static int _counter = 0;
	
	private static final String BASE_PATH = "file:///store/home/user/pictures/";
	private static String DEFAULT_NAME = "dcim";
	private static String DEFAULT_EXT = "jpg";
	
	private BinaryFileDao dao = new BinaryFileDao(BASE_PATH);
	
	public String saveImage(byte[] raw) throws Exception{
		return dao.saveBytes(raw, DEFAULT_NAME, DEFAULT_EXT);
	}
	
	public String saveImageAs(byte[] raw, String name, String extension) throws Exception{
		return dao.saveBytes(raw, name, extension);
	}
	
	public void delete(String name, String extension) throws Exception{
		dao.delete(name, extension);
	}
}
